package org.dromara.blog.domain.vo;

import org.dromara.common.translation.annotation.Translation;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.blog.domain.BlogArticle;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;



/**
 * 博客文章视图对象 blog_article
 *
 * @author LSY
 * @date 2025-11-13
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = BlogArticle.class)
public class BlogArticleVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 文章ID
     */
    @ExcelProperty(value = "文章ID")
    private Long articleId;

    /**
     * 标题
     */
    @ExcelProperty(value = "标题")
    private String title;

    /**
     * 摘要
     */
    @ExcelProperty(value = "摘要")
    private String summary;

    /**
     * 内容(Markdown/HTML)
     */
    @ExcelProperty(value = "内容(Markdown/HTML)")
    private String content;

    /**
     * 封面图
     */
    @ExcelProperty(value = "封面图")
    private String coverImage;

    /**
     * 封面图Url
     */
    @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "coverImage")
    private String coverImageUrl;
    /**
     * 是否原创 1原创 0转载
     */
    @ExcelProperty(value = "是否原创 1原创 0转载")
    private String isOriginal;

    /**
     * 转载来源URL
     */
    @ExcelProperty(value = "转载来源URL")
    private String reprintUrl;

    /**
     * 博客分类ID
     */
    @ExcelProperty(value = "博客分类ID")
    private Long categoryId;

    /**
     * 浏览量
     */
    @ExcelProperty(value = "浏览量")
    private Long viewCount;

    /**
     * 点赞数
     */
    @ExcelProperty(value = "点赞数")
    private Long likeCount;

    /**
     * 评论数
     */
    @ExcelProperty(value = "评论数")
    private Long commentCount;

    /**
     * 是否置顶（1是 0否）
     */
    @ExcelProperty(value = "是否置顶", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "1=是,0=否")
    private String isTop;

    /**
     * 排序
     */
    @ExcelProperty(value = "排序")
    private Long sort;

    /**
     * 发布时间
     */
    @ExcelProperty(value = "发布时间")
    private Date publishTime;

    /**
     * 作者昵称（冗余）
     */
    @ExcelProperty(value = "作者昵称", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "冗=余")
    private String authorName;

    /**
     * 字数统计
     */
    @ExcelProperty(value = "字数统计")
    private Long wordCount;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;

    /**
     * 状态（0正常 1停用）
     */
    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=正常,1=停用")
    private String status;


}
